<%-- 
    Document   : post
    Created on : Nov 16, 2014, 1:06:10 AM
    Author     : Hai
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<% response.setContentType("text/html; charset=UTF-8");%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@include file="Postbai/header.jsp" %>
        <script src="ckeditor/ckeditor.js" type="text/javascript"></script>
    </head>
    <body>
        <form action="/post" method="post">
            <div class="container" style="margin: auto 0px;width: 300px">
                <h1>Post Page!</h1>
                <form class="form-inline">
                    <div class="input-group"> <span class="input-group-addon">Tiêu đề</span>
                        <input type="text" class="form-control" name="title"></div>
                </form>
            </div>

            <div class="container" style="margin: auto 0px;width: 300px">
                <form class="form-inline">
                    <div class="input-group"> <span class="input-group-addon">Chuyên mục</span>

                        <select id="lunch" class="selectpicker form-control" data-live-search="true" title="Please select a lunch ...">
                            <option value="chuyendi">Chuyến Đi</option>
                            <option value="diemden">Điểm Đến</option>
                            <option value="nhatky">Nhật Ký</option>
                            <option value="thuhoach">Thu hoạch</option>
                            <option value="traingiem">Trải Nghiệm</option>
                        </select>
                    </div>
                </form>
            </div>
            <div class="container" style="margin: auto 0px;width: 300px">
                <form class="form-inline">
                    <div class="input-group"><span class="input-group-addon">Nội Dung</span><span class="input-group-btn"></div>
                </form>
            </div>

            <div class="container" style="margin: auto 0px;">
                <textarea class="ckeditor" name="content"></textarea>
                <form action="/index.jsp" method="pre">
                    <button class="btn btn-default" type="submit" name="sub" value="post">Post</button>
                    <button class="btn btn-default" type="submit" value="pre">Back</button>
                </form>
            </div>
        </form>
        <div class="map">
            <html>
                <head>
                    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
                    <script type="text/javascript"
                    src="http://code.google.com/apis/gears/gears_init.js" ></script>
                    <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false&language=vi&region=hcm"></script>
                    <script type="text/javascript">
                                var map;
                                function initialize() {
                                var myLatlng = new google.maps.LatLng(10.790141, 106.633301);
                                        var myOptions = {
                                        zoom: 16,
                                                center: myLatlng,
                                                mapTypeId: google.maps.MapTypeId.ROADMAP
                                        };
                                        map = new google.maps.Map(document.getElementById('div_id'), myOptions);
                                        if (navigator.geolocation) {
                                navigator.geolocation.getCurrentPosition(function(position) {
                                var pos = new google.maps.LatLng(position.coords.latitude,
                                        position.coords.longitude);
                                        var infowindow = new google.maps.InfoWindow({
                                        map: map,
                                                position: pos,
                                                content: "<b style='color:#00F'>Trần Văn Tiến đang ở đây</b> <br
                                                />" +
                                                "<img src='avatar.jpg' height='70' width='50' />"
                                        });
                                        map.setCenter(pos);
                                }, function() {
                                handleNoGeolocation(true);
                                });
                                }
                                else
                                {
                                handleNoGeolocation(false);
                                }
                                }
                        function handleNoGeolocation(errorFlag) {
                        if (errorFlag) {
                        var content = 'Quá trình tìm kiếm địa điểm của
                                bạn không thể thực hiện.';
                        } else {
                        var content = 'Trình duyệt của bạn không hỗ trợ ';
                        }
                        var infowindow = new google.maps.InfoWindow(options);
                                map.setCenter(options.position);
                        }
                    </script>
                </head>
                <body onload="initialize()" >
                    <div id="div_id" style="height:500px; width:500px"></div>
                </body>
            </html>


        </div>
    </body>
</html>
